/***************************************************
Class: Timer
Includes: stdafx.h
Editors: Gindi
Existing Issues: None
Description: Initializes and updates the timer.
***************************************************/
#pragma once

#include "stdafx.h"

class Timer {
public:
	Timer();
	void Start();
	void Stop();
	void Update();

	bool isStopped()			{ return m_timerStopped; }
	float getFPS()				{ return m_fps; }
	float getRunningTime()		{ return m_runningTime; }
	// if timer is stopped, return 0.0f, else return the time elapsed
	float getElapsedTime()		{ return m_timerStopped ? 0.0f : m_timeElapsed; }

private:
	INT64 m_ticksPerSecond;
	INT64 m_currentTime;
	INT64 m_lastTime;
	INT64 m_lastFPSUpdate;
	INT64 m_FPSUpdateInterval;
	UINT m_numFrames;
	float m_runningTime;
	float m_timeElapsed;
	float m_fps;
	bool m_timerStopped;
};